package com.ruoyi.web.controller.student_club.controller;

import com.github.pagehelper.PageInfo;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.student_club.dto.ActivityDto;
import com.ruoyi.student_club.service.IClubActivityService;
import com.ruoyi.student_club.vo.app.ActivityDetail;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author lin
 * @Date 2022/1/30 5:39
 */
@RestController
@RequestMapping("/app/activity")
public class ActivityAppController {

    @Resource
    private IClubActivityService activityService;

    /**
     * 获取全部社团活动列表
     * @return
     */
    @GetMapping("/getActivityList")
    public AjaxResult getActivityList(ActivityDto dto){
        PageInfo activityList = activityService.getActivityList(dto);
        return AjaxResult.success(activityList);
    }

    /**
     * 获取活动详情
     * @param id 活动id
     * @return
     */
    @GetMapping("/getActivityDetail")
    public AjaxResult getActivityDetail(Long id){
        ActivityDetail activityDetail = activityService.activityDetail(id);
        return AjaxResult.success(activityDetail);
    }

}
